﻿<%@ Page Language="C#" MasterPageFile="~/admin.master" AutoEventWireup="true" Inherits="MediaMonitor.Admin.User_Mgmt_PdfNews"
    Theme="default" Title="User Management - Send PDF" CodeBehind="user-mgmt-pdfNews.aspx.cs" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            function DateSelected(sender, eventArgs) {


                var date = eventArgs.get_renderDay().get_date();
                var dfi = sender.DateTimeFormatInfo;
                var formattedDate = dfi.FormatDate(date, dfi.ShortDatePattern);

                var calE = $find("<%= calE.ClientID %>");

             calE.selectDate(date, true)

         }

        </script>
        <script src="../rad-scripts/rad.js" type="text/javascript"></script>
    </telerik:RadCodeBlock>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>
            <div style="padding: 5px; width: 90%; position: relative;">



                <asp:HiddenField ID="hdnCompanyID" runat="server" Value="0" />
                 <fieldset>
    <legend>PDF Filters:</legend>

                <table border="0" cellpadding="0" cellspacing="0" style="margin-bottom: 20px;">
                    <tr>
                        <td colspan="2">
                            <b>Dates</b><br />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <table>
                                <tr valign="top">
                                    <td>From Date
                        <br />
                                        <telerik:RadCalendar AutoPostBack="false" ID="calS" runat="server" EnableMultiSelect="false"
                                            ClientEvents-OnDateSelected="DateSelected">
                                        </telerik:RadCalendar>
                                    </td>
                                    <td>
                                        <div style="width: 50px;"></div>
                                    </td>
                                    <td>To Date
                        <br />
                                        <telerik:RadCalendar AutoPostBack="false" ID="calE" runat="server" EnableMultiSelect="false">
                                        </telerik:RadCalendar>
                                    </td>
                                    <td>
                                        <div style="width: 50px;"></div>
                                    </td>
                                    <td>

                                        <asp:LinkButton ID="btnSend" runat="server" Text=".. Click Here to Send PDF .." OnClick="btnSend_Clicked" Font-Size="16">
                                        </asp:LinkButton>
                                    </td>

                                </tr>

                            </table>
                        </td>
                    </tr>
                    <tr >
                        <td style="padding: 10px;">Sector</td>
                        <td>
                            <asp:DropDownList ID="lstSector" runat="server" Width="400px" AutoPostBack="true" OnSelectedIndexChanged="lstSector_Changed" DataTextField="SectorName" DataValueField="SectorID" />
                        </td>

                    </tr>
                    <tr>
                        <td style="padding: 10px;">Sub Sector</td>
                        <td>
                            <asp:DropDownList ID="lstSubSector" runat="server" Width="400px" AutoPostBack="true" OnSelectedIndexChanged="lstSubSector_Changed"
                                DataTextField="SubSectorName" DataValueField="SubSectorID" />
                            <br />
                        </td>
                    </tr>
                    <tr>
                        <td style="padding: 10px;">Category</td>
                        <td>
                            <asp:DropDownList ID="lstCategory" runat="server"  Width="400px"
                                DataTextField="CategoryName" DataValueField="CategoryID" />
                        </td>
                    </tr>
                </table>
                     </fieldset>
                 <fieldset>
    <legend>Select at least one row to send email:</legend>
                <telerik:RadGrid ID="radGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                    AllowSorting="True" GridLines="None" Skin="Hay" OnNeedDataSource="radGrid_NeedDataSource"
                    Width="100%" AutoGenerateColumns="false" GroupingSettings-CaseSensitive="false"
                    PageSize="15" AllowMultiRowSelection="true">
                    <MasterTableView DataKeyNames="SiteUserID,Email" ExpandCollapseColumn-Display="true" GroupLoadMode="Client">
                        <Columns>

                            <telerik:GridClientSelectColumn ButtonType="LinkButton" Text="Select" />
                            <telerik:GridBoundColumn ShowFilterIcon="false" AllowFiltering="false" DataField="CompanyName" HeaderText="Company Name" />
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="UserName" HeaderText="Login Name" />
                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Email" HeaderText="Email" />
                            <telerik:GridBoundColumn ShowFilterIcon="false" AllowFiltering="false" DataField="Active" HeaderText="Active" />

                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Scrolling AllowScroll="false" />
                        <Selecting AllowRowSelect="true" />
                        <ClientEvents OnFilterMenuShowing="filterMenuShowing" />
                    </ClientSettings>
                    <FilterMenu OnClientShowing="MenuShowing" />
                </telerik:RadGrid>
                     </fieldset>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
